<TestCase testName="Test_04_Orchestration1_Negative">

	<TestSetup>
		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep">
			<Directory>.\..\..\TestData\ec_01\</Directory>
			<SearchPattern>*.xml</SearchPattern>
		</TestStep>

		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep">
			<Directory>.\..\..\TestData\Send_01\</Directory>
			<SearchPattern>*.xml</SearchPattern>
		</TestStep>
	</TestSetup>

	<TestExecution>
		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.HttpPostStep">
			<SourcePath>.\..\..\TestData\InDoc1.xml</SourcePath>
			<DestinationUrl>http://localhost/BizUnitSDK/BTSHTTPReceive.dll</DestinationUrl>
			<RequestTimeout>30000</RequestTimeout>
		</TestStep>

		<!-- Rename output directory to force a failure... -->
		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.RenameDirectoryStep">
			<SourceDirectory>.\..\..\TestData\Send_01</SourceDirectory>
			<DestinationDirectory>.\..\..\TestData\Send_01x</DestinationDirectory>
		</TestStep>

		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileCreateStep">
			<SourcePath>.\..\..\TestData\InDoc1.xml</SourcePath>
			<CreationPath>.\..\..\TestData\Rec_01\InDoc1.xml</CreationPath>
		</TestStep>

		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileValidateStep">
			<Timeout>10000</Timeout>
			<Directory>.\..\..\TestData\Send_Error\</Directory>
			<SearchPattern>*.xml</SearchPattern>
			<DeleteFile>true</DeleteFile>

			<ValidationStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.XmlValidationStep">
				<XmlSchemaPath>.\..\..\TestData\PO_Ack.xsd</XmlSchemaPath>
				<XmlSchemaNameSpace>http://TestFrameworkDemo.PO_Ack</XmlSchemaNameSpace>
				<XPathList>
					<XPathValidation query="/*[local-name()='POAck' and namespace-uri()='http://TestFrameworkDemo.PO_Ack']/*[local-name()='PoNumber' and namespace-uri()='']">1234</XPathValidation>
					<XPathValidation query="/*[local-name()='POAck' and namespace-uri()='http://TestFrameworkDemo.PO_Ack']/*[local-name()='Status' and namespace-uri()='']">FAIL</XPathValidation>
				</XPathList>
			</ValidationStep>
		</TestStep>

		<!-- Check event log -->
		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.EventLogCheckStep">
			<DelayBeforeCheck>0</DelayBeforeCheck>
			<!-- Optional, seconds to delay performing check -->
			<Machine></Machine>
			<!-- local machine -->
			<EventLog>Application</EventLog>
			<Source>BizTalk Server 2006</Source>
			<Type>Error</Type>
			<!-- Note: Event ID abscent!	<EventId>5754</EventId> -->
			<ValidationRegex>A message sent to adapter "FILE" on send port "BizUnit_SDK_Orch1_SendPort"</ValidationRegex>
			<ValidationRegex>.\..\..\TestData\Send_01</ValidationRegex>
			<FailIfFound>False</FailIfFound>
		</TestStep>

	</TestExecution>

	<!-- Test cleanup: test cases should always leave the system in the state they found it -->
	<TestCleanup>

		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.RenameDirectoryStep" failOnError="false" >
			<SourceDirectory>.\..\..\TestData\Send_01x</SourceDirectory>
			<DestinationDirectory>.\..\..\TestData\Send_01</DestinationDirectory>
		</TestStep>

		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep" failOnError="false" >
			<Directory>.\..\..\TestData\Rec_01\</Directory>
			<SearchPattern>*.xml</SearchPattern>
		</TestStep>

		<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep" failOnError="false" >
			<Directory>.\..\..\TestData\Send_Error\</Directory>
			<SearchPattern>*.xml</SearchPattern>
		</TestStep>

	</TestCleanup>

</TestCase>

